﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
    namespace="Sripirom.ATS.Model.ServiceLog"
        assembly="Sripirom.ATS.Model">

    <class name="ServiceTransactionLog" table="SERVICE_TRANSACTION_LOG" lazy="false" >
      <id name="Primary" column="SYSSERVICE_TRANSACTION_LOG_ID" >
        <generator class="sequence-identity">
          <param name="sequence">SEQ_SERVICE_TRANSACTION_LOG</param>
        </generator>
      </id> 

      <property name="Status">
          <column name="TRANSACTION_STATUS" sql-type="VARCHAR2(25)"  not-null="false" />
      </property>
      <property name="ChanelRequest" type="String" length="100000">
        <column name="REQUEST_MESSAGE" sql-type="CLOB"  not-null="false" />
      </property>
      <property name="ChannelReply" type="String"  length="100000">
        <column name="RESPONSE_MESSAGE" sql-type="CLOB" not-null="false" />
      </property>
      <property name="TransactionId">
        <column name="TRANSACTION_ID" sql-type="VARCHAR2(50)" not-null="false" />
      </property>
      <property name="ChannelCode">
        <column name="CHANNEL_ID" sql-type="VARCHAR2(3)" not-null="false" />
      </property>
      <property name="SysServiceId">
        <column name="SYSSERVICE_ID" sql-type="NUMBER(30,0)" not-null="false" />
      </property>
      <property name="SysTransactionId">
        <column name="SYSTRANSACTION_MODEL_LOG_ID" sql-type="NUMBER(30,0)" not-null="false" />
      </property>
      <property name="Remark">
        <column name="REMARK" sql-type="VARCHAR2(200)" not-null="false" />
      </property>
     
      <property name="CompanyCode">
        <column name="COMPANY_CODE" sql-type="VARCHAR2(12)" not-null="false" />
      </property>
      <property name="ServiceCode">
        <column name="SERVICE_CODE" sql-type="VARCHAR2(12)" not-null="false" />
      </property>
      <property name="SubServiceCode">
        <column name="SUB_SERVICE_CODE" sql-type="VARCHAR2(12)" not-null="false" />
      </property>
      <property name="TranferType">
        <column name="TRANSFER_TYPE" sql-type="VARCHAR2(10)" not-null="false" />
      </property>

      <property name="CreatedBy">
        <column name="CREATED_BY" sql-type="VARCHAR2(255)" not-null="false" />
      </property>
      <property name="CreatedDate">
        <column name="CREATED_DATETIME" sql-type="DATE" not-null="false" />
      </property>
      <property name="UpdatedBy">
        <column name="UPDATED_BY" sql-type="VARCHAR2(255)" not-null="false" />
      </property>
      <property name="UpdatedDate">
        <column name="UPDATED_DATETIME" sql-type="DATE" not-null="false" />
      </property>
      <component name="Output" class="Sripirom.ATS.Core.Messaging.MessageOutput, Sripirom.ATS.Core" >
        <property name="Result">
          <column name="ERROR_CODE" sql-type="VARCHAR2(20)" not-null="false" />
        </property>
        <property name="ErrorReason">
          <column name="ERROR_DESC" sql-type="VARCHAR2(300)" not-null="false" />
        </property>
      </component>

      <bag name="ServiceActivityLogs"  access="field.camelcase-underscore"
         inverse="true" cascade="all-delete-orphan" lazy="true" >
        <key column="SYSSERVICE_TRANSACTION_LOG_ID"  />

        <one-to-many class="ServiceActivityLog"/>
      </bag>
    </class>

</hibernate-mapping>
